import lejos.nxt.Button;
import lejos.nxt.LCD;
import lejos.nxt.LightSensor;
import lejos.nxt.SensorPort;


public class Vehicle2a {
	LightSensor l1 = new LightSensor(SensorPort.S4);
	LightSensor l2 = new LightSensor(SensorPort.S3);
	int min = 500;
	int max = 660;
	int div = (max-min)/40;
	
	public static void main(String[] args) {
		new Vehicle2a();
	}
	public Vehicle2a(){
		while(!Button.ESCAPE.isPressed()){
			int defaultSpeed = 60;
			int speed1 = (l1.readNormalizedValue()-min)/div;
			int speed2 = (l2.readNormalizedValue()-min)/div;
			LCD.drawInt(speed1, 0, 0);
			LCD.drawInt(speed2, 1, 1);
			Car.forward(defaultSpeed + speed1,defaultSpeed + speed2);	
		}
	}
}
